#pragma once

#include "Application.h"
#include "Finviz.h"
#include "Widget.h"

class CandlestickChart : public Instance
{
private:
    std::string symbal = "CandlestickChart";
    float multiple = 2;
    uint16_t id;
    uint32_t last_index;
    CandlestickChartData data;
    std::vector<std::function<void(const CandlestickChartData &data, ImDrawList *drawlist, ImVec2 canvas_pos, ImVec2 canvas_size)>> indicators;

private:
    void Begin(const char *str_id, const ImVec2 &size_arg, ImGuiChildFlags child_flags, ImGuiWindowFlags window_flags);
    void MouseCheck(const int &number_items);

public:
    CandlestickChart(uint16_t id);
    void SetCandlestickChartData(const CandlestickChartData &data);
    void Draw() override;
};